import request from '@/utils/request'

export function loginAdmin(data) {
    return request({
        url: '/api/admin/login',
        method: 'post',
        data
    })
}

// 恢复登录
export function getInfo(token) {
    return request({
        url: '/api/admin/whoami',
        method: 'get',
        params: { token }
    })
}

// 修改密码
export function setUser(data) {
    return request({
        url: '/api/admin',
        method: 'put',
        data
    })
}

export function logout() {
    return request({
        url: '/vue-admin-template/user/logout',
        method: 'post'
    })
}
